jQuery(document).ready(function(){
	jQuery('#stoepje_voucher_form').ajaxForm({
		beforeSubmit: validate,
		success: function(data){
			jQuery.colorbox({
				html: data.content,
				initialWidth: 600,
				initialHeight: 430,
				//innerWidth: 620,
				//innerHeight: 450
				onClosed: function(){
					if(data.status){
						jQuery('#stoepje_voucher_form').find('input[type="text"]').val('');
						jQuery('#stoepje_voucher_form').find('input[type="checkbox"]').prop("checked", false);
					}
				}
			});
		}
	});
	jQuery('#accept-label a').click(function(){
		jQuery.colorbox({
			href: SITE_URL + 'voucher/term_of_use',
			width: 750,
			height: 600
		});
		return false;
	});
	jQuery('#refresh-captcha').click(function(){
		//jQuery('#captcha-content').html('');
		jQuery.post(SITE_URL + 'voucher/refesh_captcha', {}, function(data){
			if(data.result){
				jQuery('#captcha-content').html(data.data);
			}
		}, 'json');
	});
});

function validate(){
	
}